

import Vue from "vue"
import VueRouter from "vue-router"

Vue.use(VueRouter);

import {menus} from "@/utils/menus"
// ()=>import("@/views/Login.vue") 路由懒加载  需要这个组件才去加载这个组件  
const routes = [
    {path:"/",redirect:"/login"},
    {path:"/login",name:"login",component:()=>import("@/views/Login.vue")},
    {   
        path:"/index",
        name:"index",
        component:()=>import("@/views/Index.vue"),
        redirect:"/index/home",
        children:[
            ...menus
        ]
    },
    {path:"404",name:"notFount",component:()=>import("@/views/errorPage/404.vue")},
    {path:"*",redirect:{name:"notFount"}}
];

const router = new VueRouter({
    routes,
    mode:"hash",
    base:""
});


export default router;